package com.kaishengit.core.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.kaishengit.pojo.City;
import com.kaishengit.service.CityService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class CityAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	Map<String,Object> session = ActionContext.getContext().getSession();
	private CityService cityService;
	private List<City> cityList=new ArrayList<City>();

	
	@Autowired
	public CityService getCityService() {
		return cityService;
	}

	
	public String execute(){
		
		cityList=	cityService.fingAll();
		session.put("cityList", cityList);
		return SUCCESS;
	}
	public void setCityService(CityService cityService) {
		this.cityService = cityService;
	}
	
}
